/*
 * @file user module header file.
 * @auther Zhiqiang wang.9264@gmail.com
 *
 */

#ifndef USER_H_
#define USER_H_
#include <netinet/in.h>
#include "length_define.h"

#define sip_user_t struct _sip_user_
struct _sip_user_
{
	char sip_username[SIP_USERNAME_LEN];
	char sip_password[20];
	char xmpp_username[128];
	char xmpp_password[128];
	char register_contact[255];
	char delete_flag;
	struct sockaddr_in client_addr;
	sip_user_t *next;
};

/**
 *
 * */
struct user_manager{
	int (* const find_user_by_sip_user_name)(char *sip_username,struct _sip_user_ **user);
};
int xmpp_2_sip_set_user_manager(struct user_manager *user_manager);
int xmpp_2_sip_find_user_by_sip_user_name(char *sip_username,struct _sip_user_ **user);
/**
 * delete deleted users. used by mod_user_pap2_voice and mod_user_config_file
 * */
int remove_deleted_users(sip_user_t **users);
#endif /* USER_H_ */
